import java.util.Scanner;
public class BreakExercise02 {
	public static void main(String[] args) {
		String name = "";
		String password = "";
		Scanner scanner = new Scanner(System.in);
		int chance = 3;
		while(true){
			System.out.println("请输入名字：");
			name = scanner.next();
			System.out.println("请输入密码：");
			password = scanner.next();
			if("丁真".equals(name) && "123456".equals(password)){
				System.out.println("登录成功");
				break;
			}else{
				System.out.println("你还有" + --chance +  "次机会");
				if(chance == 0){
					System.out.println("退出");
				break;
				}
			}
		}
	}
}